// import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex)
const state = {
  //改版 deling aa
  lang: 'zh_CN',
  // 登录相关
  token: '', //用户Token
  userObj: {}, //用户信息
  isLogin: false, //是否登录
  firstLogin: true, //是否是第一次登录
  updatePop: true,
  // 页面相关
  header: true, //头部
  title: 'GCC', //标题
  headerLeft: false, //头部左边
  // titleType: 1, //标题类型
  headerRight: true, //头部右边

  footer: true, //底部
  tabbarIndex: 0, //Tabbar索引值

  // 滚动距离
  height: 0,
  scrollTop: 0,
  tempScroll: 0,
  // 搜索相关的
  history: '',
  searchResult: [],
  // loading
  loading: false,
  // end
  // 兼容iosAPP fc
  ioshideHeader: true

}
const getters = {}
const actions = {}
const mutations = {
  // isshowTitle(state, params) {
  //   state.header = params
  // },
  changeTitle(state, params) {
    state.title = params
  },
  // isshowFooter(state, params) {
  //   state.footer = params
  // },
  changetabbarIndex(state, params) {
    state.tabbarIndex = params
  },
  scrollTop(state, params) {
    state.scrollTop = params;
  },
  height(state, params) {
    state.height = params;
  },

  // changeToken(state, params) {
  //   state.token = params
  // },
  // changeUserObj(state, params) {
  //   state.userObj = {
  //     ...state.userObj,
  //     ...params
  //   };
  // },


}

export default new Vuex.Store({
  state,
  getters,
  actions,
  mutations
})
